package com.gin.no_gay_alliance.database.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import com.gin.no_gay_alliance.database.entity.ReportingRecord;

import java.util.List;

/**
 * @author : ginstone
 * @version : v1.0.0
 * @since : 2024/1/23 15:05
 **/
@Dao
public interface ReportingRecordDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void add(ReportingRecord reportingRecord);

    @Delete
    int delete(ReportingRecord reportingRecord);

    @Query("delete FROM ReportingRecord ")
    void deleteAll();

    @Query("SELECT * FROM ReportingRecord order by id desc")
    List<ReportingRecord> listAll();
}
